home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 17 / CU Amiga Magazine's Super CD-ROM 17 (1997)(EMAP Images)(GB)[!][issue 1997-12].iso / CUCD / Programming / DiceSource / lib / extra / vfhprintf.c < prev    next >
C/C++ Source or Header  |  1997-09-09  |  735b  |  45 lines

  1.  
  2. /*
  3.  *  VFHPRINTF.C
  4.  *
  5.  *    (c)Copyright 1992-1997 Obvious Implementations Corp.  Redistribution and
  6.  *    use is allowed under the terms of the DICE-LICENSE FILE,
  7.  *    DICE-LICENSE.TXT.
  8.  */
  9.  
  10. #include <stdarg.h>
  11. #include <stdio.h>
  12. #include <clib/dos_protos.h>
  13. #include <lib/misc.h>
  14.  
  15. #ifndef HYPER
  16. #define HYPER(x) x
  17. #endif
  18.  
  19. static unsigned int
  20. _fhwrite(buf, elmsize, elms, fh)
  21. char *buf;
  22. size_t elmsize;
  23. size_t elms;
  24. void *fh;
  25. {
  26.     int r = Write((BPTR)fh, buf, elmsize * elms);
  27.     if (r >= 0)
  28.     r = r / elmsize;
  29.     return(r);
  30. }
  31.  
  32. int
  33. HYPER(vfhprintf)(fh, ctl, va)
  34. long fh;
  35. const char *ctl;
  36. va_list va;
  37. {
  38.     int error;
  39.  
  40.     error = _pfmt(ctl, va, _fhwrite, (void *)fh);
  41.     va_end(va);
  42.     return(error);      /*  count/error */
  43. }
  44.  
  45.